package kr.ac.kookmin.cs.random;

import java.util.Random;

import kr.ac.kookmin.cs.randomtest.RandomNumberSequenceGenerator;


public class JavaUtilRandom extends RandomNumberSequenceGenerator {

	Random random;
	
	public JavaUtilRandom(){

	}
	
	@Override
	public void initialize(long seed){
		super.initialize(seed);
		this.random = new Random(getSeed());
	}
	
	@Override
	protected long getNextRandomNumber(int range) {
		return random.nextInt(range);
	}

	@Override
	protected long getRandomNumberWithSeed(int range, long seed) {
		return new Random(seed).nextInt(range);
	}
	
	@Override
	protected long getNextRandomNumber(){
		int tmp = random.nextInt();
		
		return 0x00000000ffffffffL & tmp;
	}

	@Override
	protected long getRandomNumberWithSeed(long seed) {
		
		int tmp = new Random(seed).nextInt();
		return 0x00000000ffffffffL & tmp;
	}

}
